﻿@using VistaOnlineR1._1.Models.Produccion;
@model DtoOrdenDeTrabajo

@{
    Html.EnableClientValidation(); 
}

@using (Html.BeginForm("PostImprimirOrderDeTrabajo", "DiagramacionProduccion", FormMethod.Post, new { @class = "edit_form" }))
{
    
    <div class="line">
        @Html.DevExpress().Label(
            settings => {
                settings.ControlStyle.CssClass = "label";
                settings.AssociatedControlName = "CategoryID";
                settings.Text = "Category:";
            }
        ).GetHtml()
        @Html.DevExpress().ComboBox(
            settings => {
                settings.Name = "Empleado.IdEmpleado";
                settings.ControlStyle.CssClass = "editor";
                settings.Properties.TextField = "NombreApellido";
                settings.Properties.ValueField = "IdEmpleado";
                settings.Properties.ValueType = typeof(int);
            }
        ).BindList(ViewData["Empleados"]).GetHtml()
        @Html.ValidationMessageFor(model => model.empleado.IdEmpleado, null, new { @class = "validator" })
    </div>
    <div class="line">
        @Html.DevExpress().Label(
            settings => {
                settings.ControlStyle.CssClass = "label";
                settings.Text = "Fecha:";
                settings.AssociatedControlName = "Fecha";
            }
        ).GetHtml()
        @Html.DevExpress().DateEdit(
            settings => {
                settings.Name = "Fecha";
                settings.ControlStyle.CssClass = "editor";
            }
        ).Bind(Model.Fecha).GetHtml()
        @Html.ValidationMessageFor(model => model.Fecha, null, new { @class = "validator" })
    </div>
    <div class="line">
        @Html.DevExpress().Label(
            settings => {
                settings.ControlStyle.CssClass = "label";
            }
        ).GetHtml()
        @Html.DevExpress().Button(
            settings => {
                settings.Name = "btnUpdate";
                settings.ControlStyle.CssClass = "button";
                settings.Text = "Enviar";
                settings.UseSubmitBehavior = true;
            }
        ).GetHtml()
        @Html.DevExpress().Button(
            settings => {
                settings.Name = "btnCancel";
                settings.ControlStyle.CssClass = "button";
                settings.Text = "Cancelar";
                settings.ClientSideEvents.Click = "function(s, e){ document.location='" + DevExpressHelper.GetUrl(new { Controller = "DiagramacionProduccion", Action = "Index" }) + "'; }";
            }
        ).GetHtml()
    </div>
}